﻿@page
@model CampusNews.Pages.LoginModel
@{
	ViewData["Title"] = "登录";
}

<h1>登录</h1>

<form method="post">
    <div class="form-group">
        <label asp-for="Email">邮箱</label>
        <input asp-for="Email" class="form-control" />
        <span asp-validation-for="Email" class="text-danger"></span>
    </div>
    <button type="submit" class="btn btn-primary">发送登录链接</button>
</form>

@if (Model.Message != null)
{
    <div class="alert alert-info">@Model.Message</div>
}

@if (Model.Token != null)
{
    @if (Model.IsValidToken)
    {
        <div class="alert alert-success">登录成功！</div>
    }
    else
    {
        <div class="alert alert-danger">无效的登录链接或链接已过期。</div>
    }
}    